<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "{{%customer}}".
 *
 * @property integer $id
 * @property string $username
 * @property string $password
 * @property string $realname
 * @property string $phone
 * @property integer $areaid
 * @property string $address
 * @property integer $blue
 * @property integer $green
 * @property integer $type
 * @property integer $createtime
 */
class Customer extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%customer}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['username', 'password', 'realname', 'phone', 'address', 'type', 'createtime'], 'required'],
            [['areaid', 'blue', 'green', 'type', 'createtime','updatetime'], 'integer'],
            [['username', 'password', 'realname', 'address'], 'string', 'max' => 255],
            [['phone'], 'string', 'max' => 11],
            [['username'], 'unique'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'username' => 'Username',
            'password' => 'Password',
            'realname' => 'Realname',
            'phone' => 'Phone',
            'areaid' => 'Areaid',
            'address' => 'Address',
            'blue' => 'Blue',
            'green' => 'Green',
            'type' => 'Type',
            'createtime' => 'Createtime',
            'updatetime'=>'Updatetime',
        ];
    }
}
